$(function(){
	$("#creat-new-module-btn").click(function() {
		var index = layer.open({
			type: 1,
			title: '新建版块',
			fixed: false, //不固定
			maxmin: true,
			closeBtn: 1,
			scrollbar: false,
			area: 'auto',
			content: $("#create-new-module-layer")
		});
		layer.full(index);
	});
	
	$("#module-creat-btn").click(function() {
		//addModule();
		window.location.reload();
		//$(".task-index").show();
	});
	
	$("#manage-module").click(function() {
		var index = layer.open({
			type: 1,
			title: '管理版块',
			fixed: false, //不固定
			maxmin: true,
			closeBtn: 1,
			scrollbar: false,
			area: 'auto',
			content: $("#module-manage-layer")
		});
		layer.full(index);
	});
	
	$("#module-manage-btn").click(function() {
		//addModule();
		window.location.reload();
		//$(".task-index").show();
	});
});

var init = function() {
	var editorTask = new wangEditor('editor-task');
	editorTask.config.menus = [
	    'fullscreen',
	    ' | ',
		'bold',
		'underline',
		'italic',
		'strikethrough',
		'eraser',
		'forecolor',
		'bgcolor',
		'quote',
		'fontfamily',
		'fontsize',
		'head',
		'unorderlist',
		'orderlist',
		'alignleft',
		'aligncenter',
		'alignright',
		'link',
		'unlink',
		'table',
		'emotion',
		'img',
		'video',
		'insertcode',
		'undo',
		'redo'
    ];
	
	editorTask.config.uploadImgUrl = CONTEXT_PATH + 'resource/editUpload';
	editorTask.config.uploadImgFileName='editor-task';
	editorTask.config.zindex = 20000;
	editorTask.create();
}